<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function parkingSystem(big, medium, small) {
      //1.创建大中小三种车位数量
      this.carPort = {
        "1": big,
        "2": medium,
        "3": small
      }
    };
    ParkingSystem.prototype.addCar = function (carType) {
      let currentStillPort = this.carPort[carType]
      //2.进车查询是否还有对应车位
      if (currentStillPort) {
        //有车位，进车，修改对应车位数量，并进行返回
        this.carPort[carType] = currentStillPort - 1
        return true
      } else {
        //无车位直接返回
        return false
      }
    };
    console.log();
  </script>
</body>

</html>